﻿using Shop.RemoteModel.AdvertPlace;
using Shop.RemoteModel.AdvertPlace.Model;
using Shop.Service.Interface;
using WeDonekRpc.Client;
using WeDonekRpc.Client.Interface;

namespace Shop.Service.RpcEvent
{
    internal class AdvertPlaceEvent : IRpcApiService
    {
        private readonly IAdvertPlaceService _Service;

        public AdvertPlaceEvent ( IAdvertPlaceService service )
        {
            this._Service = service;
        }
        public PagingResult<AdvertPlaceDto> QueryAdvertPlace ( QueryAdvertPlace obj )
        {
            return this._Service.Query(obj.QueryParam, obj.ToBasicPage());
        }
        public Dictionary<long, string> GetPlaceExampleImg ( GetPlaceExampleImg obj )
        {
            return this._Service.GetExampleImg(obj.PlaceType);
        }
        public AdvertPlaceItem[] GetAdvertPlaceItems ( GetAdvertPlaceItems query )
        {
            return this._Service.GetItems(query.Param);
        }
        public AdvertPlaceConfig GetAdvertPlaceConfig ( GetAdvertPlaceConfig obj )
        {
            return this._Service.GetPlaceConfig(obj.Id);
        }
        public void EnableAdvertPlace ( EnableAdvertPlace obj )
        {
            this._Service.Enable(obj.Id);
        }

        public void StopAdvertPlace ( StopAdvertPlace obj )
        {
            this._Service.Stop(obj.Id);
        }
        public long AddAdvertPlace ( AddAdvertPlace obj )
        {
            return this._Service.Add(obj.Datum);
        }

        public void DeleteAdvertPlace ( DeleteAdvertPlace obj )
        {
            this._Service.Delete(obj.Id);
        }

        public AdvertPlace GetAdvertPlace ( GetAdvertPlace obj )
        {
            return this._Service.Get(obj.Id);
        }

        public AdvertPlaceDto[] GetsAdvertPlace ( GetsAdvertPlace obj )
        {
            return this._Service.Gets(obj.Status);
        }

        public bool SetAdvertPlace ( SetAdvertPlace obj )
        {
            return this._Service.Set(obj.Id, obj.Datum);
        }
    }
}
